/*
A ColorState is a defined r,g,b point in time.
author : @totetmatt
*/
#ifndef Transition_h
#define Transition_h

#include "Arduino.h"
#include "Colorstate.h"

class Transition
{
    public:

    Transition(ColorState* from, ColorState* to);
   
     void setFromState(ColorState* from);
     ColorState* getFromState();
 
     void setToState(ColorState* to);
     ColorState* getToState();
     
     boolean isFinish();
     

    
    void nextState(ColorState* next);
    
    void doTransition();
    void doStep(); 
    ColorState* currentState();
    private:
      ColorState* _from;
      ColorState* _to;
      
      ColorState* _transition;
      
      double _deltaRed;
      double _deltaGreen;
      double _deltaBlue;
      
      void computeDelta();
      void initTransitionState();
      
      int _loopCounter;
      
};
#endif
